<%@page import="com.neiquan.backstage.common.util.Sessions"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.User"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.Entrepreneur"%>
<%@page import="com.neiquan.backstage.resourec_manage.EntrepreneurService"%>
<%@page import="com.neiquan.backstage.common.util.Configs"%>
<%@page import="java.util.List"%>
<%@page import="com.neiquan.backstage.event.EventService"%>
<%@page import="com.neiquan.backstage.common.util.SpringContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
ApplicationContext appCtx = SpringContextUtils.getApplicationContext();
User loginedUser = (User) Sessions.getLoginedUser(session);
int memberId=loginedUser.getMemberId();
String uniqueId=loginedUser.getEntrepreneurUniqueId();
EntrepreneurService entrepreneurService = appCtx.getBean(EntrepreneurService.class);
Entrepreneur entrepreneur = entrepreneurService.queryByUniqueId(uniqueId,memberId);
pageContext.setAttribute("entrepreneur", entrepreneur);
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>公司资料</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/main.css" />
	<script type="text/javascript">
	    window.ZBJInfo = {
	        baseURI: "zbj.com",
	        newStaticLibURI: "http://t6.zbjimg.com",
	        qiniuUploadTokenUrl: "http://rms.zhubajie.com"
	    };
	    window.ZBJInfo.attach_list = [{"file_id":"7729683","filename":"homesite\/task\/%u65B0%u5EFA%u6587%u672C%u6587%u6863.txt\/origine\/b62bdc7e-4400-4b67-b004-a9834a05be04","ofilename":"\u65b0\u5efa\u6587\u672c\u6587\u6863.txt","createtime":"1450085834","task_id":"6360159","filesize":"1","filext":"txt","user_id":"44","nickname":"cc01","tfPath":"","soundtimea":"0"},{"file_id":"7729685","filename":"homesite\/task\/%u4EFB%u610F%u7C7B%u578B.m4a\/origine\/1436d51d-5aa0-4eb9-bc06-b66721a28f5e","ofilename":"\u4efb\u610f\u7c7b\u578b.m4a","createtime":"1450085834","task_id":"6360159","filesize":"8388607","filext":"m4a","user_id":"44","nickname":"cc01","tfPath":"","soundtimea":"0"}] || [];
	</script>
	<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.9.0/jquery.min.js"></script>
	<script type="text/javascript" id="seajsnode" src="http://t6.zbjimg.com/seajs/seajs/2.1.1/sea.js"></script>
	<script type="text/javascript" src="http://t6.zbjimg.com/seajs/seajs-style/1.0.0/seajs-style.js"></script>
	<script type="text/javascript" src="http://t6.zbjimg.com/output/seajs-config.js"></script>
</head>
<body bgcolor="#f0f0f0">
		<section class="mt activesignup">
			<section class="tc">
				<form id="companyform" class="fom" >
					<section>
						<p class="addrvisitor-title pd">公司资料</p>
						<section class="line"></section>
						<section class="common_bg">
							<section class="perfect company-perfect pd">
								<p class="form-inpt-p">
									<label>团队/公司名称</label><input  class="inpt" form="companyform" value='${entrepreneur.name }'  id="name" name="name" type="text" placeholder="请输入您的公司全称" />
								</p>
								<div class="c">
									<label>团队/公司LOGO</label>
									<div class="relative logo_div">
										<img id="loge1" src="${entrepreneur.loge}" width="150px">
										<input type="file" id="extraInfoUploadBtn3" name="fileToUpload" class="fileToUpload zbj-upload-btn" onchange="fileSelected();" style="display:block;">
									</div>
								  <div class="demo-preview" id="demoPreview"></div>
								</div>
								<p class="form-inpt-p">
									<label class="vistor-instuct">团队/公司简介</label><textarea class="inpt vistor-instuct-text" id="description" name="description" form="companyform"  placeholder="请您的输入团队或公司的简介..." />${entrepreneur.description }</textarea>
								</p>
							</section>
						</section>
					</section>
					<section class="common_bg mt">
						<p class="addrvisitor-title pd">联系信息</p>
						<section class="line"></section>
						<section>
							<section class="perfect pd">
								<p class="form-inpt-p">
									<label>联系人</label><input class="inpt" form="companyform" id="linkman" name="linkman" type="text" value='${entrepreneur.linkman }' placeholder="请输入您的真实姓名" />
								</p>
								<p class="form-inpt-p">
									<label>手机号</label><input class="inpt" form="companyform" id="phone" name="phone" type="tel" value='${entrepreneur.phone }' placeholder="请输入您的手机号码" />
								</p>
								<p class="form-inpt-p">
									<label>邮件</label><input class="inpt" form="companyform" id="mail" name="mail" type="text" value='${entrepreneur.mail }' placeholder="请输入您的邮箱号码" />
								</p>
								<p class="form-inpt-p">
									<label>联系地址</label><input class="inpt" form="companyform" id="address" name="address" type="text" value='${entrepreneur.address }' placeholder="请输入您的联系地址" />
								</p>
							</section>
						</section>
					</section>
					<section class="common_bg mt">
						<p class="addrvisitor-title pd">项目信息</p>
						<section class="line"></section>
						<section>
							<section class="perfect pd">
								<section class="form-inpt-p relative">
									<label>项目类别</label><input readonly="readonly" class="inpt project-type" form="companyform" value='${entrepreneur.projectType }' id="projectType" name="projectType" type="text"  placeholder="互联网金融" />
									<ul class="project-type-select area_select" style="display: none">
										<li>移动互联网</li>
										<li>电子商务</li>
										<li>新媒体</li>
										<li>数据服务</li>
										<li>其他</li>
									</ul>
								</section>
								<p class="form-inpt-p">
									<label class="vistor-instuct">项目介绍</label><textarea class="inpt vistor-instuct-text" form="companyform"  id="projectDesc" name="projectDesc" placeholder="最多输入200字（创意来源、可行性、商业模式等相关介绍）..." />${entrepreneur.projectDesc}</textarea>
								</p>
								<p class="form-inpt-p">
									<label class="team-num">目前团队人数</label><input class="inpt" form="companyform" id="teamSize" name="teamSize" type="text" value='${entrepreneur.teamSize}' placeholder="请输入您的团队人数" />
								</p>
							</section>
						</section>
					</section>
					<input id="id" name="id" value='${entrepreneur.entrepreneurId }' style="display: none"/>
					<input class="btn fom-submit company-btn" onClick="submit1()" type="button" value="提交申请">
				</form>
			</section>
		</section>
</body>
<script src="js/jquery.min.js"></script>		
<script src="js/responsive.js"></script>
<script src="js/main.js"></script>
<script type="text/javascript">
	var self = this;
	var QINIU_UPLOAD_TOKEN_URL = ZBJInfo.qiniuUploadTokenUrl;
	var uploadedImgUrl = '';
	seajs.use(['components/uploader-qiniu/uploader-qiniu'], function(Uploader) {
	    var extraUploader = new Uploader.baseUploader({
	        browse_button: "extraInfoUploadBtn3",
	        acceptExt: [
	            { title : "Image files", extensions : "jpg,gif,png,bmp,jpeg,tif,eps" }
	        ],
	        prevent_duplicates : false,
	        max_file_size : "1024kb",
	        count_limit : 5,
	        belongToDomain: 'homesite',
	        belongToSystem: 'task',
	        tokenUrl: QINIU_UPLOAD_TOKEN_URL+'/resource/'
	    });
	   /*  extraUploader.on('progress', function(up, file){
	        $('#demoPreview').html(file.percent+'%');
	    }); */
	    extraUploader.on('uploaded', function(up, file){
	        var key = extraUploader.tokenObj[file.name][1];
	        var url = extraUploader.getUrl(key).previewUrl;
	        uploadedImgUrl = url;
	        $("#loge1").attr("src",uploadedImgUrl);
	    });
	});
	</script>
	<script type="text/javascript">
	//提交修改
	function submit1() {
		var param = {
			"id":$("#id").val(),
			"name": $("#name").val(),
			"loge": $("#loge1").attr("src"),
			"description": $("#description").val(),
			"linkman": $("#linkman").val(),
			"phone":$("#phone").val(),
			"mail":$("#mail").val(),
			"address":$("#address").val(),
			"projectType":$("#projectType").val(),
			"projectDesc":$("#projectDesc").val(),
			"teamSize":$("#teamSize").val(),
		};
		$.post("api/allianceEntrepreneur/edit", param, function(data) {
			if (data.code != 0) {
				alert(data.errorMessage);
				return;
			}
			alert("修改成功");
			window.location.href="myworkaddr.jsp";
		}); 
	}
	</script>
	<script>
			$(function(){
				var zhubajieH = $('.copyprint-top-right').height();
				$('.copyprint-top').height(zhubajieH);
				$('.copyprint-bottom').height(window.innerHeight - zhubajieH - 60);
			})
	</script>
	<script>
			$(function(){
				var W = ($('.logo-right').width() - $('.company-img').width())/2
					H = ($('.logo-right').height() - $('.company-img').height())/2
					Left = $('.project-type').offset().left - 50;
				$('.logo-img-wrap').css({left:W,top:0});
				$('.project-type-select li').width($('.project-type').width());
				$('.project-type-select').css("left",Left);
			});
		</script>

</html>
